Skip to content

dd: warn when skip goes past the end of the input file#13115

Open
eyupcanakman wants to merge 1 commit into
uutils:mainfrom
eyupcanakman:fix/dd-skip-past-eof-13047
Open

dd: warn when skip goes past the end of the input file#13115
eyupcanakman wants to merge 1 commit into
uutils:mainfrom
eyupcanakman:fix/dd-skip-past-eof-13047

Conversation

@eyupcanakman

Copy link
Copy Markdown
Contributor

dd if=FILE skip=N past the end of FILE did not print GNU's cannot skip to specified offset. The File source now checks the seek result.

Closes #13047

The File source seeked without checking the resulting offset against the file size, so dd did not print GNU's "cannot skip to specified offset" message.
Add the check the seekable-stdin path already has, and guard both arms so an empty file stays silent, matching GNU.

Closes uutils#13047
@github-actions

Copy link
Copy Markdown

GNU testsuite comparison:

GNU test failed: tests/dd/misc. tests/dd/misc is passing on 'main'. Maybe you have to rebase?
Skip an intermittent issue tests/cut/bounded-memory (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/date/date-locale-hour (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/tail/follow-name (passes in this run but fails in the 'main' branch)
Note: The gnu test tests/cp/link-heap is now being skipped but was previously passing.
Note: The gnu test tests/seq/seq-epipe is now being skipped but was previously passing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dd: output when skip beyond input file differs from the gnu dd

1 participant